home *** CD-ROM | disk | FTP | other *** search
- (*---------------------------------------------------------------------------*)
- (* Number -- Pick up Number from PibList command line *)
- (*---------------------------------------------------------------------------*)
-
- PROCEDURE Number( VAR n: REAL );
-
- (*---------------------------------------------------------------------------*)
- (* *)
- (* Routine: Number *)
- (* *)
- (* Purpose: Pick up Number from PibList command line *)
- (* *)
- (* Calling Sequence: *)
- (* *)
- (* Number( VAR n: REAL ); *)
- (* *)
- (* n --- returned Number *)
- (* *)
- (* Calls: None *)
- (* *)
- (* Called By: Display_Screen *)
- (* *)
- (* Remarks: *)
- (* *)
- (* If the next character in the command line is not a digit, a 1 is *)
- (* returned as the value for 'n'. *)
- (* *)
- (*---------------------------------------------------------------------------*)
-
- BEGIN (* Number *)
-
- IF NOT( command[cind] IN ['0'..'9'] ) THEN
- n := 1.0
- ELSE
- BEGIN
- n := 0.0;
- REPEAT
- n := 10.0 * n + ORD( command[cind] ) - ORD('0');
- cind := cind + 1;
- UNTIL NOT( command[cind] in ['0'..'9'] );
- END;
-
- END (* Number *);